<%@ include file="/WEB-INF/common/taglibs.jsp"%>
<% if (request.getAttribute("struts.valueStack") != null) { %>
<%-- ActionError Messages - usually set in Actions --%>
<s:if test="hasActionErrors()">
	<div id="errorMessages" class="notification msgerror">
        <a class="close"></a>
         <s:iterator value="actionErrors">
			<p><s:property/></p>
		</s:iterator>
    </div><!-- notification msgerror -->
</s:if>

<%-- FieldError Messages - usually set by validation rules --%>
<s:if test="hasFieldErrors()">
   	<div id="errorMessages" class="notification msgerror">
		<a class="close"></a>
		<!-- 
		<div style="width:55px;height:51px;border-right: 1px solid #FF8B7C;float:left;border-radius: 2px 2px 2px 2px;"></div>
		-->
		<s:iterator value="fieldErrors">
		    <s:iterator value="value">
		       <p><s:property/></p>
		    </s:iterator>
		</s:iterator>
   </div>
</s:if>

<s:if test='hasActionMessages()'>
	<div id="successMessages" class="notification msgsuccess">
		<a class="close"></a>
		<s:iterator value="actionMessages" status="rows">
			<p><s:property escape="false"/></p>
		</s:iterator>
	</div>
</s:if>
<% } %>

<%-- Success Messages --%>
<c:if test="${not empty messages}">
	 <div id="successMessages" class="notification msgsuccess">
        <a class="close"></a>
        <c:forEach var="msg" items="${messages}">
            <p><c:out value="${msg}"/><br /></p>
       	</c:forEach>
     </div><!-- notification msgsuccess -->
	<c:remove var="messages" scope="session"/>		                    
</c:if>

<%-- Error Messages (on JSPs, not through Struts --%>
<c:if test="${not empty errors}">
    <div id="errorMessages" class="notification msgerror">
        <a class="close"></a>
        <c:forEach var="error" items="${errors}">
            <p><c:out value="${error}"/></p>
        </c:forEach>
    </div><!-- notification msgerror -->
    <c:remove var="errors" scope="session"/>
</c:if>